package QL;

import java.util.List;
import java.util.ArrayList;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

public class ButlerCdkeyGroupInfo implements IQLResponse
{
    /// <summary>
    /// 激活码分组Id
    /// </summary>
    public long GroupId;

    /// <summary>
    /// 激活码分组名称
    /// </summary>
    public String GroupName;

    /// <summary>
    /// 激活码奖励物品
    /// </summary>
    public String GroupRewards;

    /// <summary>
    /// 激活码总数量
    /// </summary>
    public long CodeCountTotal;

    /// <summary>
    /// 已使用的激活码数量
    /// </summary>
    public long CodeCountUsed;

    /// <summary>
    /// 已废弃的激活码数量
    /// </summary>
    public long CodeCountAbandoned;

    /// <summary>
    /// 分组创建时间
    /// </summary>
    public String CreateTime;

    @Override
    public void DeserializeFromJson(JSONObject jsonObj)
    {
        JSONObject t = jsonObj;
        if (t.has("group_id"))
            GroupId = t.getLong("group_id");
        if (t.has("group_name"))
            GroupName = t.getString("group_name");
        if (t.has("group_rewards"))
            GroupRewards = t.getString("group_rewards");
        if (t.has("code_count_total"))
            CodeCountTotal = t.getLong("code_count_total");
        if (t.has("code_count_used"))
            CodeCountUsed = t.getLong("code_count_used");
        if (t.has("code_count_abandoned"))
            CodeCountAbandoned = t.getLong("code_count_abandoned");
        if (t.has("create_time"))
            CreateTime = t.getString("create_time");
    }
}
